﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;

namespace OpenDynDnsChanger.AdminApp.MVVM
{
    public class RelayCommand<T> : ICommand
    {
        public RelayCommand(Action<T> Action)
        {
            this._action = Action;
        }

        Action<T> _action;


        public bool CanExecute(object parameter)
        {
            return this._action != null;
        }

        public event EventHandler CanExecuteChanged;

        public void Execute(object parameter)
        {
            _action.Invoke((T)parameter);
        }
    }
}
